<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .continar{
            width:1000px;
            margin:0 auto;
        }
        .nav{
            text-align: center;
            border-bottom:1px solid #ccc;
            height:31px;
            box-sizing: border-box;
        }
        .nav a{
            display:inline-block;
            box-sizing: border-box;
            height:31px;
            text-decoration:none;
            color:#fff;
            background:aqua;
            padding:5px 20px;
            margin:0 20px;
            border:1px solid #ccc;
            
        }
        .nav a:hover,.nav .on{
            border:1px solid #ccc;
            border-bottom:1px solid #fff;
            background:#fff;
            color:#aaa;
        }
        .box{
            margin-top:5px;
        }
        .box div{
            width:1000px;
            height:400px;
            
        }
        .box div:nth-child(1){
            background:pink;
        }
        .box div:nth-child(2){
            background:#ff0;
            display:none;
        }
        .box div:nth-child(3){
            background:#0a0;
            display:none;
        }
    </style>
</head>
<body>
    <div class="continar">
        <div class="nav">
            <a href="" class="on">网站首页</a>
            <a href="">赛事中心</a>
            <a href="">官方商城</a>
        </div>
        <div class="box">
            <div>1111</div>
            <div>2222</div>
            <div>3333</div>
        </div>
    </div>
    <script>
        var btn=document.querySelectorAll('.nav a');
        var box=document.querySelectorAll('.box div');

        btn.forEach(function(v,i){
            v.onmouseover=function(){
                box.forEach(function(v1,i1){
                    v1.style.display='none';
                });
                box[i].style.display='block';
                btn.forEach(function(v2,i2){
                    v2.className='';
                });
                this.className='on';
            }
        });
    </script>
</body>
</html>